{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method fit in module scipy.stats._continuous_distns:\n",
      "\n",
      "fit(data, **kwds) method of scipy.stats._continuous_distns.norm_gen instance\n",
      "    Return MLEs for shape (if applicable), location, and scale\n",
      "    parameters from data.\n",
      "    \n",
      "    MLE stands for Maximum Likelihood Estimate.  Starting estimates for\n",
      "    the fit are given by input arguments; for any arguments not provided\n",
      "    with starting estimates, ``self._fitstart(data)`` is called to generate\n",
      "    such.\n",
      "    \n",
      "    One can hold some parameters fixed to specific values by passing in\n",
      "    keyword arguments ``f0``, ``f1``, ..., ``fn`` (for shape parameters)\n",
      "    and ``floc`` and ``fscale`` (for location and scale parameters,\n",
      "    respectively).\n",
      "    \n",
      "    Parameters\n",
      "    ----------\n",
      "    data : array_like\n",
      "        Data to use in calculating the MLEs.\n",
      "    args : floats, optional\n",
      "        Starting value(s) for any shape-characterizing arguments (those not\n",
      "        provided will be determined by a call to ``_fitstart(data)``).\n",
      "        No default value.\n",
      "    kwds : floats, optional\n",
      "        Starting values for the location and scale parameters; no default.\n",
      "        Special keyword arguments are recognized as holding certain\n",
      "        parameters fixed:\n",
      "    \n",
      "        - f0...fn : hold respective shape parameters fixed.\n",
      "          Alternatively, shape parameters to fix can be specified by name.\n",
      "          For example, if ``self.shapes == \"a, b\"``, ``fa``and ``fix_a``\n",
      "          are equivalent to ``f0``, and ``fb`` and ``fix_b`` are\n",
      "          equivalent to ``f1``.\n",
      "    \n",
      "        - floc : hold location parameter fixed to specified value.\n",
      "    \n",
      "        - fscale : hold scale parameter fixed to specified value.\n",
      "    \n",
      "        - optimizer : The optimizer to use.  The optimizer must take ``func``,\n",
      "          and starting position as the first two arguments,\n",
      "          plus ``args`` (for extra arguments to pass to the\n",
      "          function to be optimized) and ``disp=0`` to suppress\n",
      "          output as keyword arguments.\n",
      "    \n",
      "    Returns\n",
      "    -------\n",
      "    mle_tuple : tuple of floats\n",
      "        MLEs for any shape parameters (if applicable), followed by those\n",
      "        for location and scale. For most random variables, shape statistics\n",
      "        will be returned, but there are exceptions (e.g. ``norm``).\n",
      "    \n",
      "    Notes\n",
      "    -----\n",
      "    This function uses explicit formulas for the maximum likelihood\n",
      "    estimation of the normal distribution parameters, so the\n",
      "    `optimizer` argument is ignored.\n",
      "    \n",
      "    Examples\n",
      "    --------\n",
      "    \n",
      "    Generate some data to fit: draw random variates from the `beta`\n",
      "    distribution\n",
      "    \n",
      "    >>> from scipy.stats import beta\n",
      "    >>> a, b = 1., 2.\n",
      "    >>> x = beta.rvs(a, b, size=1000)\n",
      "    \n",
      "    Now we can fit all four parameters (``a``, ``b``, ``loc`` and ``scale``):\n",
      "    \n",
      "    >>> a1, b1, loc1, scale1 = beta.fit(x)\n",
      "    \n",
      "    We can also use some prior knowledge about the dataset: let's keep\n",
      "    ``loc`` and ``scale`` fixed:\n",
      "    \n",
      "    >>> a1, b1, loc1, scale1 = beta.fit(x, floc=0, fscale=1)\n",
      "    >>> loc1, scale1\n",
      "    (0, 1)\n",
      "    \n",
      "    We can also keep shape parameters fixed by using ``f``-keywords. To\n",
      "    keep the zero-th shape parameter ``a`` equal 1, use ``f0=1`` or,\n",
      "    equivalently, ``fa=1``:\n",
      "    \n",
      "    >>> a1, b1, loc1, scale1 = beta.fit(x, fa=1, floc=0, fscale=1)\n",
      "    >>> a1\n",
      "    1\n",
      "    \n",
      "    Not all distributions return estimates for the shape parameters.\n",
      "    ``norm`` for example just returns estimates for location and scale:\n",
      "    \n",
      "    >>> from scipy.stats import norm\n",
      "    >>> x = norm.rvs(a, b, size=1000, random_state=123)\n",
      "    >>> loc1, scale1 = norm.fit(x)\n",
      "    >>> loc1, scale1\n",
      "    (0.92087172783841631, 2.0015750750324668)\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import scipy.io as spio\n",
    "import scipy.stats as stats\n",
    "\n",
    "help(stats.norm.fit)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
